package indi.zhifa.study2024.nbr.busycore.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import indi.zhifa.core.common.web.entity.ann.ZhiFaRestController;
import indi.zhifa.study2024.nbr.busycore.logic.report.consign.IConsignService;
import indi.zhifa.study2024.nbr.busycore.logic.report.consign.entity.mapperOut.ConsignMapperOut;
import indi.zhifa.study2024.nbr.busycore.logic.report.consign.entity.request.ConsignPageRequest;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

@Slf4j
@Validated
@RequiredArgsConstructor
@RequestMapping(value = "/api/nbr/busy-core/consign")
@ZhiFaRestController
@Tag(name = "销售报表")
public class ConsignController {
    private final IConsignService mConsignService;

    @Operation(summary = "销售报表-商品分组")
    @PostMapping("/report/groupByItem")
    public Page<ConsignMapperOut> pageGroupByItemId(@RequestBody ConsignPageRequest pConsignPageRequest){
        return mConsignService.pageGroupByItemId(pConsignPageRequest);
    }
}
